cmake_minimum_required(VERSION 3.20)
project(amalgam_opengl)

message(STATUS "****************************")
message(STATUS "* Building OpenGL Renderer *")
message(STATUS "****************************")
set(INCDIR "${CMAKE_CURRENT_LIST_DIR}/include")
set(SRCS
  "${CMAKE_CURRENT_LIST_DIR}/Renderer.cpp"
)
add_library(${PROJECT_NAME} SHARED ${SRCS})
add_library(amalgam::renderer ALIAS ${PROJECT_NAME})
target_include_directories(${PROJECT_NAME} PUBLIC ${INCDIR})
target_link_libraries(${PROJECT_NAME} glfw GLEW::GLEW)

if(WITH_TESTS)
    add_executable(learn_gl "${CMAKE_CURRENT_LIST_DIR}/tests/LearnGL.cpp")
    target_link_libraries(learn_gl glfw GLEW::GLEW)
    add_test(NAME learn_gl COMMAND learn_gl)
endif()
